home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch6f < prev    next >
Encoding:
Internet Message Format  |  1989-11-27  |  57.2 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i059:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch6f
  5. Message-ID: <4848@tekred.CNA.TEK.COM>
  6. Date: 22 Nov 89 19:49:25 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 2137
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 8, Issue 59
  13. Archive-name: NetHack3/Patch6f
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16.  
  17.  
  18. #! /bin/sh
  19. # This is a shell archive.  Remove anything before this line, then unpack
  20. # it by saving it into a file and typing "sh file".  To overwrite existing
  21. # files, type "sh file -c".  You can also feed this as standard input via
  22. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  23. # will see the following message at the end:
  24. #        "End of archive 6 (of 15)."
  25. # Contents:  patches06g
  26. # Wrapped by billr@saab on Wed Nov 22 10:50:11 1989
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f 'patches06g' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'patches06g'\"
  30. else
  31. echo shar: Extracting \"'patches06g'\" \(54581 characters\)
  32. sed "s/^X//" >'patches06g' <<'END_OF_FILE'
  33. X*** src/Old/exper.c    Sun Nov 19 12:40:48 1989
  34. X--- src/exper.c    Wed Nov  8 19:39:17 1989
  35. X***************
  36. X*** 1,4 ****
  37. X! /*    SCCS Id: @(#)exper.c    3.0    89/04/21
  38. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  39. X  /* NetHack may be freely redistributed.  See license for details. */
  40. X  
  41. X--- 1,4 ----
  42. X! /*    SCCS Id: @(#)exper.c    3.0    89/11/08
  43. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  44. X  /* NetHack may be freely redistributed.  See license for details. */
  45. X  
  46. X***************
  47. X*** 15,21 ****
  48. X      return(0L * lev);
  49. X  #else
  50. X      if(lev < 10) return (10L*(1L << lev));
  51. X!     if(lev < 20) return (10000L*(1L << lev-10));
  52. X      return (10000000L*(lev-19));
  53. X  #endif
  54. X  }
  55. X--- 15,21 ----
  56. X      return(0L * lev);
  57. X  #else
  58. X      if(lev < 10) return (10L*(1L << lev));
  59. X!     if(lev < 20) return (10000L*(1L << (lev-10)));
  60. X      return (10000000L*(lev-19));
  61. X  #endif
  62. X  }
  63. X*** src/Old/extralev.c    Sun Nov 19 12:41:04 1989
  64. X--- src/extralev.c    Tue Oct 31 22:18:58 1989
  65. X***************
  66. X*** 29,36 ****
  67. X--- 29,40 ----
  68. X  int horiz;
  69. X  {
  70. X      register int x,y,middle;
  71. X+ #ifndef MAX
  72. X  #define MAX(a,b) (((a) > (b)) ? (a) : (b))
  73. X+ #endif
  74. X+ #ifndef MIN
  75. X  #define MIN(a,b) (((a) < (b)) ? (a) : (b))
  76. X+ #endif
  77. X      if (horiz) {
  78. X          middle = x1 + rn2(x2-x1+1);
  79. X          for(x=MIN(x1,middle); x<=MAX(x1,middle); x++)
  80. X***************
  81. X*** 71,76 ****
  82. X--- 75,81 ----
  83. X                                      fromy);
  84. X              dodoor(fromx, fromy, &rooms[r[x][y].nroom]);
  85. X              levl[fromx][fromy].doormask = D_NODOOR;
  86. X+             mnewsym(fromx,fromy);
  87. X              fromy++;
  88. X          }
  89. X          if(y >= 2) {
  90. X***************
  91. X*** 90,95 ****
  92. X--- 95,101 ----
  93. X                  impossible("up: no wall at %d,%d?",tox,toy);
  94. X              dodoor(tox, toy, &rooms[r[x][y].nroom]);
  95. X              levl[tox][toy].doormask = D_NODOOR;
  96. X+             mnewsym(tox,toy);
  97. X              toy--;
  98. X          }
  99. X          roguejoin(fromx, fromy, tox, toy, FALSE);
  100. X***************
  101. X*** 108,113 ****
  102. X--- 114,120 ----
  103. X                                      fromy);
  104. X              dodoor(fromx, fromy, &rooms[r[x][y].nroom]);
  105. X              levl[fromx][fromy].doormask = D_NODOOR;
  106. X+             mnewsym(fromx,fromy);
  107. X              fromx++;
  108. X          }
  109. X          if(x >= 2) {
  110. X***************
  111. X*** 127,132 ****
  112. X--- 134,140 ----
  113. X                  impossible("left: no wall at %d,%d?",tox,toy);
  114. X              dodoor(tox, toy, &rooms[r[x][y].nroom]);
  115. X              levl[tox][toy].doormask = D_NODOOR;
  116. X+             mnewsym(tox,toy);
  117. X              tox--;
  118. X          }
  119. X          roguejoin(fromx, fromy, tox, toy, TRUE);
  120. X***************
  121. X*** 307,312 ****
  122. X--- 315,321 ----
  123. X  
  124. X  void
  125. X  corr(x,y)
  126. X+ int x, y;
  127. X  {
  128. X      if (rn2(50)) {
  129. X          levl[x][y].typ = CORR;
  130. X***************
  131. X*** 313,319 ****
  132. X          levl[x][y].scrsym = CORR_SYM;
  133. X      } else {
  134. X          levl[x][y].typ = SCORR;
  135. X!         levl[x][y].scrsym = STONE_SYM;
  136. X      }
  137. X  }
  138. X  
  139. X--- 322,328 ----
  140. X          levl[x][y].scrsym = CORR_SYM;
  141. X      } else {
  142. X          levl[x][y].typ = SCORR;
  143. X!         levl[x][y].scrsym = ' ';    /* _not_ STONE_SYM */
  144. X      }
  145. X  }
  146. X  
  147. X*** src/Old/fountain.c    Sun Nov 19 12:41:22 1989
  148. X--- src/fountain.c    Sat Nov 18 21:17:32 1989
  149. X***************
  150. X*** 85,92 ****
  151. X               
  152. X          levl[mx][my].typ = POOL;
  153. X          levl[mx][my].doormask = 0;
  154. X!         if(!Blind) atl(mx,my,(char) POOL_SYM);
  155. X!         else levl[mx][my].seen = 0;
  156. X          madepool = 1;
  157. X      }
  158. X  
  159. X--- 85,93 ----
  160. X               
  161. X          levl[mx][my].typ = POOL;
  162. X          levl[mx][my].doormask = 0;
  163. X!         mnewsym(mx,my);
  164. X!         if (cansee(mx, my))
  165. X!         prl(mx, my);
  166. X          madepool = 1;
  167. X      }
  168. X  
  169. X***************
  170. X*** 99,105 ****
  171. X  
  172. X      if (!Blind) You("spot a gem in the sparkling waters!");
  173. X      (void) mkobj_at(GEM_SYM,u.ux,u.uy);
  174. X!     levl[u.ux][u.uy].doormask = T_LOOTED;
  175. X  }
  176. X  
  177. X  void
  178. X--- 100,106 ----
  179. X  
  180. X      if (!Blind) You("spot a gem in the sparkling waters!");
  181. X      (void) mkobj_at(GEM_SYM,u.ux,u.uy);
  182. X!     levl[u.ux][u.uy].looted = T_LOOTED;
  183. X  }
  184. X  
  185. X  void
  186. X***************
  187. X*** 107,113 ****
  188. X      if (!rn2(3) && IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
  189. X          pline("The fountain dries up!");
  190. X          levl[u.ux][u.uy].typ = ROOM;
  191. X!         levl[u.ux][u.uy].doormask = 0;
  192. X          if(Invisible) newsym(u.ux, u.uy);
  193. X          fountsound--;
  194. X      }
  195. X--- 108,114 ----
  196. X      if (!rn2(3) && IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
  197. X          pline("The fountain dries up!");
  198. X          levl[u.ux][u.uy].typ = ROOM;
  199. X!         levl[u.ux][u.uy].looted = 0;
  200. X          if(Invisible) newsym(u.ux, u.uy);
  201. X          fountsound--;
  202. X      }
  203. X***************
  204. X*** 131,137 ****
  205. X  
  206. X          case 19: /* Self-knowledge */
  207. X  
  208. X!             You("feel self-knowledgable...");
  209. X              more();
  210. X              enlightenment();
  211. X              pline("The feeling subsides.");
  212. X--- 132,138 ----
  213. X  
  214. X          case 19: /* Self-knowledge */
  215. X  
  216. X!             You("feel self-knowledgeable...");
  217. X              more();
  218. X              enlightenment();
  219. X              pline("The feeling subsides.");
  220. X***************
  221. X*** 193,199 ****
  222. X  
  223. X          case 27: /* Find a gem in the sparkling waters. */
  224. X  
  225. X!             if (levl[u.ux][u.uy].doormask == 0) {
  226. X                  dofindgem();
  227. X                  break;
  228. X              }
  229. X--- 194,200 ----
  230. X  
  231. X          case 27: /* Find a gem in the sparkling waters. */
  232. X  
  233. X!             if (!levl[u.ux][u.uy].looted) {
  234. X                  dofindgem();
  235. X                  break;
  236. X              }
  237. X***************
  238. X*** 230,274 ****
  239. X  dipfountain(obj)
  240. X  register struct obj *obj;
  241. X  {
  242. X!     register int fate = rnd(30);
  243. X  
  244. X!     if(Levitation)    You("are floating high above the fountain.");
  245. X!     else if(fate<10)
  246. X!         if(!obj->rustfree && is_sword(obj)) {
  247. X!             if(obj->spe > -6) {
  248. X!                 Your("sword rusts somewhat.");
  249. X!                 obj->spe--;
  250. X!             } else Your("sword looks quite rusted.");
  251. X!         } else pline("Well, it looks wet now.");
  252. X!     else if(fate<14)
  253. X!         if(obj->otyp == LONG_SWORD
  254. X  #ifndef NAMED_ITEMS
  255. X!            && !strcmp(ONAME(obj), "Excalibur")
  256. X  #endif
  257. X!            && u.ulevel >= 5
  258. X!         ) {
  259. X!             /* The lady of the lake acts! - Eric Backus */
  260. X!             /* Be *REAL* nice to him */
  261. X      pline("A murky hand from the depths reaches up to bless the sword.");
  262. X      pline("As the hand retreats, the fountain disappears!");
  263. X  
  264. X  #ifndef NAMED_ITEMS
  265. X!             if(obj->spe < 5) obj->spe = 5;
  266. X  #else
  267. X!             /* otherwise +rnd(10) / +5 "Super"sword */
  268. X!             obj = oname(obj, "Excalibur", 1);
  269. X  #endif
  270. X!             bless(obj);
  271. X!             obj->rustfree = 1;
  272. X!             levl[u.ux][u.uy].typ = ROOM;
  273. X!             if(Invisible) newsym(u.ux, u.uy);
  274. X!             fountsound--;
  275. X!             return;
  276. X!         } else pline ("Well, it looks wet now.");
  277. X!     else {
  278. X!         switch (fate) {
  279. X          case 16: /* Curse the item */
  280. X-             pline("Well, it looks wet now.");
  281. X              curse(obj);
  282. X              break;
  283. X          case 17:
  284. X--- 231,268 ----
  285. X  dipfountain(obj)
  286. X  register struct obj *obj;
  287. X  {
  288. X!     if (Levitation) {
  289. X!         You("are floating high above the fountain.");
  290. X!         return;
  291. X!     }
  292. X  
  293. X!     if (obj->otyp == LONG_SWORD && u.ulevel >= 5 && !rn2(6)
  294. X  #ifndef NAMED_ITEMS
  295. X!         && !strcmp(ONAME(obj), "Excalibur")
  296. X  #endif
  297. X!        ) {
  298. X!         /* The lady of the lake acts! - Eric Backus */
  299. X!         /* Be *REAL* nice */
  300. X      pline("A murky hand from the depths reaches up to bless the sword.");
  301. X      pline("As the hand retreats, the fountain disappears!");
  302. X  
  303. X  #ifndef NAMED_ITEMS
  304. X!         if(obj->spe < 5) obj->spe = 5;
  305. X  #else
  306. X!         /* otherwise +rnd(10) / +5 "Super"sword */
  307. X!         obj = oname(obj, "Excalibur", 1);
  308. X  #endif
  309. X!         bless(obj);
  310. X!         obj->rustfree = 1;
  311. X!         levl[u.ux][u.uy].typ = ROOM;
  312. X!                 levl[u.ux][u.uy].looted = 0;
  313. X!         if(Invisible) newsym(u.ux, u.uy);
  314. X!         fountsound--;
  315. X!         return;
  316. X!     } else (void) get_wet(obj);
  317. X! 
  318. X!     switch (rnd(30)) {
  319. X          case 16: /* Curse the item */
  320. X              curse(obj);
  321. X              break;
  322. X          case 17:
  323. X***************
  324. X*** 289,295 ****
  325. X          case 22: /* Water Nymph */
  326. X              dowaternymph();
  327. X              break;
  328. X!         case 23: /* An Endless Stream Of Snakes */
  329. X              dowatersnakes();
  330. X              break;
  331. X          case 24: /* Find a gem */
  332. X--- 283,289 ----
  333. X          case 22: /* Water Nymph */
  334. X              dowaternymph();
  335. X              break;
  336. X!         case 23: /* an Endless Stream of Snakes */
  337. X              dowatersnakes();
  338. X              break;
  339. X          case 24: /* Find a gem */
  340. X***************
  341. X*** 308,330 ****
  342. X          case 28: /* Strange feeling */
  343. X              pline("An urge to take a bath overwhelms you.");
  344. X              if (u.ugold > 10) {
  345. X!                      u.ugold -= somegold()/10;
  346. X!               You("lost some of your gold in the fountain!");
  347. X!               levl[u.ux][u.uy].doormask = 0;
  348. X!              }
  349. X              break;
  350. X          case 29: /* You see coins */
  351. X  
  352. X          /* We make fountains have more coins the closer you are to the
  353. X           * surface.  After all, there will have been more people going
  354. X!          * by.  Just like a shopping mall!  Chris Woodbury  */
  355. X  
  356. X!             mkgold((long)(rnd((MAXLEVEL-dlevel)*2)+5),u.ux,u.uy);
  357. X          pline("Far below you, you see coins glistening in the water.");
  358. X              break;
  359. X-         default:
  360. X-             break;
  361. X-         }
  362. X      }
  363. X      dryup();
  364. X      return;
  365. X--- 302,321 ----
  366. X          case 28: /* Strange feeling */
  367. X              pline("An urge to take a bath overwhelms you.");
  368. X              if (u.ugold > 10) {
  369. X!                 u.ugold -= somegold() / 10;
  370. X!                 You("lost some of your gold in the fountain!");
  371. X!                 levl[u.ux][u.uy].looted = 0;
  372. X!             }
  373. X              break;
  374. X          case 29: /* You see coins */
  375. X  
  376. X          /* We make fountains have more coins the closer you are to the
  377. X           * surface.  After all, there will have been more people going
  378. X!          * by.    Just like a shopping mall!  Chris Woodbury  */
  379. X  
  380. X!             mkgold((long)(rnd((MAXLEVEL-dlevel)*2)+5), u.ux, u.uy);
  381. X          pline("Far below you, you see coins glistening in the water.");
  382. X              break;
  383. X      }
  384. X      dryup();
  385. X      return;
  386. X***************
  387. X*** 377,386 ****
  388. X              (void) dopotion(otmp);
  389. X              obfree(otmp, (struct obj *)0);
  390. X              break;
  391. X!         case 5: if (levl[u.ux][u.uy].doormask == 0) {
  392. X                  You("find a ring in the sink!");
  393. X                  (void) mkobj_at(RING_SYM, u.ux, u.uy);
  394. X!                 levl[u.ux][u.uy].doormask = T_LOOTED;
  395. X              } else pline("Some dirty water backs up in the drain.");
  396. X              break;
  397. X          case 6: pline("The pipes break!  Water spurts out!");
  398. X--- 368,377 ----
  399. X              (void) dopotion(otmp);
  400. X              obfree(otmp, (struct obj *)0);
  401. X              break;
  402. X!         case 5: if (!levl[u.ux][u.uy].looted) {
  403. X                  You("find a ring in the sink!");
  404. X                  (void) mkobj_at(RING_SYM, u.ux, u.uy);
  405. X!                 levl[u.ux][u.uy].looted = T_LOOTED;
  406. X              } else pline("Some dirty water backs up in the drain.");
  407. X              break;
  408. X          case 6: pline("The pipes break!  Water spurts out!");
  409. X*** src/Old/getline.c    Sun Nov 19 12:41:43 1989
  410. X--- src/getline.c    Sun Nov  5 16:15:49 1989
  411. X***************
  412. X*** 165,171 ****
  413. X      }
  414. X      in_line[0] = foo;
  415. X      in_line[1] = 0;
  416. X!     if(foo == 'g' || foo == 'G'){
  417. X          in_line[1] = Getchar();
  418. X  #ifdef REDO
  419. X          savech(in_line[1]);
  420. X--- 165,171 ----
  421. X      }
  422. X      in_line[0] = foo;
  423. X      in_line[1] = 0;
  424. X!     if(foo == 'g' || foo == 'G' || (flags.num_pad && foo == '5')){
  425. X          in_line[1] = Getchar();
  426. X  #ifdef REDO
  427. X          savech(in_line[1]);
  428. X*** src/Old/hack.c    Sun Nov 19 12:42:00 1989
  429. X--- src/hack.c    Wed Nov  8 22:56:43 1989
  430. X***************
  431. X*** 4,10 ****
  432. X  #include "hack.h"
  433. X  
  434. X  #if defined(UNIX) && !defined(LINT)
  435. X! static    const char    SCCS_Id[] = "@(#)hack.c    3.0\t88/10/25";
  436. X  #endif
  437. X  
  438. X  /* called on movement:
  439. X--- 4,10 ----
  440. X  #include "hack.h"
  441. X  
  442. X  #if defined(UNIX) && !defined(LINT)
  443. X! static    const char    SCCS_Id[] = "@(#)hack.c    3.0\t89/11/03";
  444. X  #endif
  445. X  
  446. X  /* called on movement:
  447. X***************
  448. X*** 24,30 ****
  449. X          for(y = u.uy-1; y < u.uy+2; y++) {
  450. X          if(!isok(x, y)) continue;
  451. X          lev = &levl[x][y];
  452. X!         if(!lev->lit && lev->scrsym == ROOM_SYM) {
  453. X              lev->scrsym = STONE_SYM;
  454. X              lev->new = 1;
  455. X              on_scr(x,y);
  456. X--- 24,30 ----
  457. X          for(y = u.uy-1; y < u.uy+2; y++) {
  458. X          if(!isok(x, y)) continue;
  459. X          lev = &levl[x][y];
  460. X!         if(!lev->lit && IS_FLOOR(lev->typ)){
  461. X              lev->scrsym = STONE_SYM;
  462. X              lev->new = 1;
  463. X              on_scr(x,y);
  464. X***************
  465. X*** 46,52 ****
  466. X      in trap.c:   seeoff(1)    - fall through trapdoor
  467. X   */
  468. X  void
  469. X! seeoff(mode) {    /* 1 to redo @, 0 to leave them */
  470. X          /* 1 means misc movement, 0 means blindness */
  471. X      register xchar x,y;
  472. X      register struct rm *lev;
  473. X--- 46,54 ----
  474. X      in trap.c:   seeoff(1)    - fall through trapdoor
  475. X   */
  476. X  void
  477. X! seeoff(mode)
  478. X! int mode;
  479. X! {        /* 1 to redo @, 0 to leave them */
  480. X          /* 1 means misc movement, 0 means blindness */
  481. X      register xchar x,y;
  482. X      register struct rm *lev;
  483. X***************
  484. X*** 65,71 ****
  485. X              lev = &levl[x][y];
  486. X              if(MON_AT(x, y))
  487. X                  unpmon(m_at(x,y));
  488. X!             if(!lev->lit && lev->scrsym == ROOM_SYM) {
  489. X                  lev->seen = 0;
  490. X                  atl(x, y, (char)STONE_SYM);
  491. X              }
  492. X--- 67,73 ----
  493. X              lev = &levl[x][y];
  494. X              if(MON_AT(x, y))
  495. X                  unpmon(m_at(x,y));
  496. X!             if(!lev->lit && IS_FLOOR(lev->typ)) {
  497. X                  lev->seen = 0;
  498. X                  atl(x, y, (char)STONE_SYM);
  499. X              }
  500. X***************
  501. X*** 94,100 ****
  502. X          }
  503. X  #endif
  504. X          if(isok(rx,ry) && !IS_ROCK(levl[rx][ry].typ) &&
  505. X!             (!IS_DOOR(levl[rx][ry].typ) || !(u.dx && u.dy)) &&
  506. X              !sobj_at(BOULDER, rx, ry)) {
  507. X              if(MON_AT(rx, ry)) {
  508. X                  mtmp = m_at(rx,ry);
  509. X--- 96,106 ----
  510. X          }
  511. X  #endif
  512. X          if(isok(rx,ry) && !IS_ROCK(levl[rx][ry].typ) &&
  513. X!             (!IS_DOOR(levl[rx][ry].typ) || !(u.dx && u.dy) || (
  514. X! #ifdef REINCARNATION
  515. X!             dlevel != rogue_level &&
  516. X! #endif
  517. X!              (levl[rx][ry].doormask & ~D_BROKEN) == D_NODOOR)) &&
  518. X              !sobj_at(BOULDER, rx, ry)) {
  519. X              if(MON_AT(rx, ry)) {
  520. X                  mtmp = m_at(rx,ry);
  521. X***************
  522. X*** 229,238 ****
  523. X  # endif
  524. X          You("crash to the floor!");
  525. X          losehp((rn1(10, 20 - (int)ACURR(A_CON))),"fall onto a sink");
  526. X!         if(OBJ_AT(u.ux, u.uy))
  527. X!         for(obj=fobj; obj; obj=obj->nobj)
  528. X!             if(obj->ox == u.ux && obj->oy == u.uy &&
  529. X!                obj->olet == WEAPON_SYM) {
  530. X              You("fell on %s.",doname(obj));
  531. X              losehp(rn2(3),"fall onto a sink");
  532. X              }
  533. X--- 235,242 ----
  534. X  # endif
  535. X          You("crash to the floor!");
  536. X          losehp((rn1(10, 20 - (int)ACURR(A_CON))),"fall onto a sink");
  537. X!         for(obj = level.objects[u.ux][u.uy]; obj; obj = obj->nexthere)
  538. X!             if(obj->olet == WEAPON_SYM) {
  539. X              You("fell on %s.",doname(obj));
  540. X              losehp(rn2(3),"fall onto a sink");
  541. X              }
  542. X***************
  543. X*** 451,459 ****
  544. X      if(bad_rock(x,y) ||
  545. X         (u.dx && u.dy
  546. X  #ifdef POLYSELF
  547. X!             && !passes_walls(uasmon)
  548. X  #endif
  549. X-             && (IS_DOOR(tmpr->typ) || IS_DOOR(ust->typ)))){
  550. X          flags.move = 0;
  551. X          nomul(0);
  552. X          return;
  553. X--- 455,471 ----
  554. X      if(bad_rock(x,y) ||
  555. X         (u.dx && u.dy
  556. X  #ifdef POLYSELF
  557. X!             && !passes_walls(uasmon)
  558. X! #endif
  559. X! #ifdef REINCARNATION
  560. X!             && (((IS_DOOR(tmpr->typ) && ((tmpr->doormask & ~D_BROKEN)
  561. X!                 || dlevel == rogue_level)) ||
  562. X!                 ((IS_DOOR(ust->typ) && ((ust->doormask & ~D_BROKEN)
  563. X!                 || dlevel == rogue_level))))))) {
  564. X! #else
  565. X!             && (((IS_DOOR(tmpr->typ) && (tmpr->doormask & ~D_BROKEN)) ||
  566. X!               ((IS_DOOR(ust->typ) && (ust->doormask & ~D_BROKEN))))))){
  567. X  #endif
  568. X          flags.move = 0;
  569. X          nomul(0);
  570. X          return;
  571. X***************
  572. X*** 521,527 ****
  573. X          } else {
  574. X              if (IS_WALL(tmpr->typ)) {
  575. X                  digtxt = "You chew a hole in the wall.";
  576. X!                 tmpr->typ = DOOR;
  577. X              } else if (tmpr->typ==SDOOR) {
  578. X                  digtxt = "You chew through a secret door.";
  579. X                  tmpr->typ = DOOR;
  580. X--- 533,542 ----
  581. X          } else {
  582. X              if (IS_WALL(tmpr->typ)) {
  583. X                  digtxt = "You chew a hole in the wall.";
  584. X!                 if(!is_maze_lev)
  585. X!                   tmpr->typ = DOOR;
  586. X!                 else
  587. X!                   tmpr->typ = ROOM;
  588. X              } else if (tmpr->typ==SDOOR) {
  589. X                  digtxt = "You chew through a secret door.";
  590. X                  tmpr->typ = DOOR;
  591. X***************
  592. X*** 537,542 ****
  593. X--- 552,559 ----
  594. X              if(IS_DOOR(tmpr->typ) && (tmpr->doormask & D_TRAPPED)) {
  595. X                  b_trapped("door");
  596. X                  tmpr->doormask = D_NODOOR;
  597. X+                 mnewsym(x, y);
  598. X+                 prl(x, y);
  599. X              }
  600. X              dig_level = -1;
  601. X          }
  602. X***************
  603. X*** 696,701 ****
  604. X--- 713,721 ----
  605. X  #endif
  606. X      if(Blind || flags.run == 0) return;
  607. X      for(x = u.ux-1; x <= u.ux+1; x++) for(y = u.uy-1; y <= u.uy+1; y++) {
  608. X+ #ifdef POLYSELF
  609. X+         if(u.umonnum == PM_GRID_BUG && x != u.ux && y != u.uy) continue;
  610. X+ #endif
  611. X          if(x == u.ux && y == u.uy) continue;
  612. X          if(MON_AT(x, y) && (mtmp = m_at(x,y)) && !mtmp->mimic &&
  613. X              (!mtmp->minvis || See_invisible) && !mtmp->mundetected) {
  614. X***************
  615. X*** 707,714 ****
  616. X          {
  617. X          register uchar sym = levl[x][y].scrsym;
  618. X  
  619. X!         if (IS_ROCK(levl[x][y].typ) || sym == ROOM_SYM) continue;
  620. X!         else if (sym == DOOR_SYM) {
  621. X              if(x != u.ux && y != u.uy) continue;
  622. X              if(flags.run != 1) goto stop;
  623. X              goto bcorr;
  624. X--- 727,736 ----
  625. X          {
  626. X          register uchar sym = levl[x][y].scrsym;
  627. X  
  628. X!         if (IS_ROCK(levl[x][y].typ) ||
  629. X!            (sym == ROOM_SYM && !IS_DOOR(levl[x][y].typ)))
  630. X!              continue;
  631. X!         else if (sym == CLOSED_DOOR_SYM) {
  632. X              if(x != u.ux && y != u.uy) continue;
  633. X              if(flags.run != 1) goto stop;
  634. X              goto bcorr;
  635. X***************
  636. X*** 927,933 ****
  637. X  void
  638. X  losehp(n, knam)
  639. X      register int n;
  640. X!     register char *knam;
  641. X  {
  642. X  #ifdef POLYSELF
  643. X      if (u.mtimedone) {
  644. X--- 949,955 ----
  645. X  void
  646. X  losehp(n, knam)
  647. X      register int n;
  648. X!     register const char *knam;
  649. X  {
  650. X  #ifdef POLYSELF
  651. X      if (u.mtimedone) {
  652. X***************
  653. X*** 943,949 ****
  654. X          u.uhpmax = u.uhp;    /* perhaps n was negative */
  655. X      flags.botl = 1;
  656. X      if(u.uhp < 1) {
  657. X!         killer = knam;    /* the thing that killed you */
  658. X          You("die...");
  659. X          done(DIED);
  660. X      } else if(u.uhp*10 < u.uhpmax && moves-wailmsg > 50 && n > 0){
  661. X--- 965,971 ----
  662. X          u.uhpmax = u.uhp;    /* perhaps n was negative */
  663. X      flags.botl = 1;
  664. X      if(u.uhp < 1) {
  665. X!         killer = (char *)knam;    /* the thing that killed you */
  666. X          You("die...");
  667. X          done(DIED);
  668. X      } else if(u.uhp*10 < u.uhpmax && moves-wailmsg > 50 && n > 0){
  669. X*** src/Old/invent.c    Sun Nov 19 12:42:44 1989
  670. X--- src/invent.c    Tue Nov 14 21:24:36 1989
  671. X***************
  672. X*** 140,146 ****
  673. X--- 140,148 ----
  674. X  register struct obj *obj;
  675. X  {
  676. X      if(obj->quan > 1){
  677. X+ #ifndef NO_SIGNAL
  678. X          obj->in_use = FALSE;    /* no longer in use */
  679. X+ #endif
  680. X          obj->quan--;
  681. X          obj->owt = weight(obj);
  682. X      } else {
  683. X***************
  684. X*** 252,259 ****
  685. X  {
  686. X      register struct obj *otmp;
  687. X  
  688. X!     if(OBJ_AT(x, y))
  689. X!         for(otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere)
  690. X          if(otmp->otyp == n)
  691. X              return(otmp);
  692. X      return((struct obj *)0);
  693. X--- 254,260 ----
  694. X  {
  695. X      register struct obj *otmp;
  696. X  
  697. X!     for(otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere)
  698. X          if(otmp->otyp == n)
  699. X              return(otmp);
  700. X      return((struct obj *)0);
  701. X***************
  702. X*** 282,287 ****
  703. X--- 283,299 ----
  704. X      return((struct obj *) 0);
  705. X  }
  706. X  
  707. X+ boolean
  708. X+ have_lizard()
  709. X+ {
  710. X+     register struct obj *otmp;
  711. X+ 
  712. X+     for(otmp = invent; otmp; otmp = otmp->nobj)
  713. X+         if(otmp->otyp == CORPSE && otmp->corpsenm == PM_LIZARD)
  714. X+             return(TRUE);
  715. X+     return(FALSE);
  716. X+ }
  717. X+ 
  718. X  struct obj *
  719. X  o_on(id, objchn)
  720. X  unsigned int id;
  721. X***************
  722. X*** 294,299 ****
  723. X--- 306,323 ----
  724. X      return((struct obj *) 0);
  725. X  }
  726. X  
  727. X+ boolean
  728. X+ obj_here(obj, x, y)
  729. X+ register struct obj *obj;
  730. X+ int x, y;
  731. X+ {
  732. X+     register struct obj *otmp;
  733. X+ 
  734. X+     for(otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere)
  735. X+         if(obj == otmp) return(TRUE);
  736. X+     return(FALSE);
  737. X+ }
  738. X+ 
  739. X  struct gold *
  740. X  g_at(x,y)
  741. X  register int x, y;
  742. X***************
  743. X*** 331,337 ****
  744. X   */
  745. X  struct obj *
  746. X  getobj(let,word)
  747. X! register char *let,*word;
  748. X  {
  749. X      register struct obj *otmp;
  750. X      register char ilet,ilet1,ilet2;
  751. X--- 355,361 ----
  752. X   */
  753. X  struct obj *
  754. X  getobj(let,word)
  755. X! register const char *let,*word;
  756. X  {
  757. X      register struct obj *otmp;
  758. X      register char ilet,ilet1,ilet2;
  759. X***************
  760. X*** 395,400 ****
  761. X--- 419,427 ----
  762. X          || (!strcmp(word, "rub") &&
  763. X              (otmp->olet == TOOL_SYM &&
  764. X               otmp->otyp != LAMP && otmp->otyp != MAGIC_LAMP))
  765. X+         || (!strcmp(word, "wield") &&
  766. X+             (otmp->olet == TOOL_SYM &&
  767. X+              otmp->otyp != PICK_AXE && otmp->otyp != UNICORN_HORN))
  768. X              )
  769. X              foo--;
  770. X          }
  771. X***************
  772. X*** 540,546 ****
  773. X      return(otmp);
  774. X  }
  775. X  
  776. X! static int
  777. X  ckunpaid(otmp)
  778. X  register struct obj *otmp;
  779. X  {
  780. X--- 567,576 ----
  781. X      return(otmp);
  782. X  }
  783. X  
  784. X! #ifndef OVERLAY
  785. X! static 
  786. X! #endif
  787. X! int
  788. X  ckunpaid(otmp)
  789. X  register struct obj *otmp;
  790. X  {
  791. X***************
  792. X*** 1033,1054 ****
  793. X  
  794. X          cornline(0, "Things that are here:");
  795. X          for(otmp = otmp0; otmp; otmp = otmp->nexthere) {
  796. X!         if(otmp->ox == u.ux && otmp->oy == u.uy) {
  797. X!                 ct++;
  798. X!                 cornline(1, doname(otmp));
  799. X  
  800. X!                 if(Blind  && !uarmg &&
  801. X  #ifdef POLYSELF
  802. X!             !resists_ston(uasmon) &&
  803. X  #endif
  804. X!                    (otmp->otyp == CORPSE && otmp->corpsenm == PM_COCKATRICE)) {
  805. X!                 pline("Touching the dead cockatrice is a fatal mistake...");
  806. X!                 You("turn to stone...");
  807. X!                 killer = "cockatrice corpse";
  808. X!                 done(STONING);
  809. X!                 }
  810. X          }
  811. X!         }
  812. X  
  813. X          if(gold) {
  814. X          char gbuf[30];
  815. X--- 1063,1082 ----
  816. X  
  817. X          cornline(0, "Things that are here:");
  818. X          for(otmp = otmp0; otmp; otmp = otmp->nexthere) {
  819. X!         ct++;
  820. X!         cornline(1, doname(otmp));
  821. X  
  822. X!         if(Blind  && !uarmg &&
  823. X  #ifdef POLYSELF
  824. X!             !resists_ston(uasmon) &&
  825. X  #endif
  826. X!             (otmp->otyp == CORPSE && otmp->corpsenm == PM_COCKATRICE)) {
  827. X!             pline("Touching the dead cockatrice is a fatal mistake...");
  828. X!             You("turn to stone...");
  829. X!             killer = "cockatrice corpse";
  830. X!             done(STONING);
  831. X          }
  832. X!     }
  833. X  
  834. X          if(gold) {
  835. X          char gbuf[30];
  836. X***************
  837. X*** 1074,1084 ****
  838. X  stackobj(obj)
  839. X  register struct obj *obj;
  840. X  {
  841. X!     register struct obj *otmp = fobj;
  842. X!     for(otmp = fobj; otmp; otmp = otmp->nobj) if(otmp != obj)
  843. X!         if(otmp->ox == obj->ox && otmp->oy == obj->oy &&
  844. X!             merged(obj,otmp,1))
  845. X!                 break;
  846. X      return;
  847. X  }
  848. X  
  849. X--- 1102,1112 ----
  850. X  stackobj(obj)
  851. X  register struct obj *obj;
  852. X  {
  853. X!     register struct obj *otmp;
  854. X! 
  855. X!     for(otmp = level.objects[obj->ox][obj->oy]; otmp; otmp = otmp->nexthere)
  856. X!         if(otmp != obj && merged(obj,otmp,1))
  857. X!             break;
  858. X      return;
  859. X  }
  860. X  
  861. X***************
  862. X*** 1097,1103 ****
  863. X      else if((obj->olet==WEAPON_SYM || obj->olet==ARMOR_SYM) &&
  864. X          obj->rustfree != otmp->rustfree) return FALSE;
  865. X  
  866. X!     else if(obj->olet == FOOD_SYM && obj->oeaten != otmp->oeaten)
  867. X          return(FALSE);
  868. X  
  869. X      else if(obj->otyp == CORPSE || obj->otyp == EGG || obj->otyp == TIN)
  870. X--- 1125,1132 ----
  871. X      else if((obj->olet==WEAPON_SYM || obj->olet==ARMOR_SYM) &&
  872. X          obj->rustfree != otmp->rustfree) return FALSE;
  873. X  
  874. X!     else if(obj->olet == FOOD_SYM && (obj->oeaten != otmp->oeaten ||
  875. X!         obj->orotten != otmp->orotten))
  876. X          return(FALSE);
  877. X  
  878. X      else if(obj->otyp == CORPSE || obj->otyp == EGG || obj->otyp == TIN)
  879. X***************
  880. X*** 1205,1221 ****
  881. X  }
  882. X  
  883. X  /*
  884. X!  * useupf(obj)
  885. X!  * uses up an object that's on the floor
  886. X   */
  887. X  void
  888. X  useupf(obj)
  889. X  register struct obj *obj;
  890. X  {
  891. X!     if(obj->quan > 1)  {
  892. X!         obj->quan--;
  893. X!         obj->owt = weight(obj);
  894. X!     }  else delobj(obj);
  895. X  }
  896. X  
  897. X  /*
  898. X--- 1234,1255 ----
  899. X  }
  900. X  
  901. X  /*
  902. X!  * uses up an object that's on the floor, charging for it as necessary
  903. X   */
  904. X  void
  905. X  useupf(obj)
  906. X  register struct obj *obj;
  907. X  {
  908. X!     register struct obj *otmp;
  909. X! 
  910. X!     /* burn_floor_paper() keeps an object pointer that it tries to
  911. X!      * useupf() multiple times, so obj must survive if plural */
  912. X!     if(obj->quan > 1)
  913. X!         otmp = splitobj(obj, (int)obj->quan - 1);
  914. X!     else
  915. X!         otmp = obj;
  916. X!     addtobill(otmp, FALSE);
  917. X!     delobj(otmp);
  918. X  }
  919. X  
  920. X  /*
  921. X***************
  922. X*** 1241,1253 ****
  923. X  let_to_name(let)
  924. X  char let;
  925. X  {
  926. X!     char *pos = index(obj_symbols, let);
  927. X      /* arbitrary buffer size by Tom May (tom@uw-warp) */
  928. X      static char *buf = NULL;
  929. X  
  930. X      if (buf == NULL)
  931. X!         buf = (char *) alloc ((unsigned)(strlen(HI)+strlen(HE)+15+1));
  932. X! 
  933. X      if (pos == NULL) pos = obj_symbols;
  934. X      if (HI && HE)
  935. X          Sprintf(buf, "%s%s%s", HI, names[pos - obj_symbols], HE);
  936. X--- 1275,1292 ----
  937. X  let_to_name(let)
  938. X  char let;
  939. X  {
  940. X!     const char *pos = index(obj_symbols, let);
  941. X      /* arbitrary buffer size by Tom May (tom@uw-warp) */
  942. X      static char *buf = NULL;
  943. X  
  944. X      if (buf == NULL)
  945. X!         buf = (char *) alloc ((unsigned)(strlen(HI)+17+strlen(HE)));
  946. X! /* 
  947. X!    THE ALLOC() *MUST* BE BIG ENOUGH TO ACCOMODATE THE LONGEST NAME PLUS A
  948. X!    NULL BYTE: 
  949. X!             Boulders/Statues   +  '\0'
  950. X!             1234567890123456 = 16 + 1 = 17
  951. X! */
  952. X      if (pos == NULL) pos = obj_symbols;
  953. X      if (HI && HE)
  954. X          Sprintf(buf, "%s%s%s", HI, names[pos - obj_symbols], HE);
  955. X*** src/Old/ioctl.c    Sun Nov 19 12:43:31 1989
  956. X--- src/ioctl.c    Sun Nov 19 11:53:02 1989
  957. X***************
  958. X*** 13,19 ****
  959. X  
  960. X  #if defined(BSD) || defined(ULTRIX)
  961. X  #include    <sgtty.h>
  962. X! struct ltchars ltchars, ltchars0;
  963. X  #else
  964. X  #include    <termio.h>    /* also includes part of <sgtty.h> */
  965. X  struct termio termio;
  966. X--- 13,20 ----
  967. X  
  968. X  #if defined(BSD) || defined(ULTRIX)
  969. X  #include    <sgtty.h>
  970. X! struct ltchars ltchars;
  971. X! struct ltchars ltchars0 = { -1, -1, -1, -1, -1, -1 }; /* turn all off */
  972. X  #else
  973. X  #include    <termio.h>    /* also includes part of <sgtty.h> */
  974. X  struct termio termio;
  975. X*** src/Old/lev_comp.l    Sun Nov 19 12:44:52 1989
  976. X--- src/lev_comp.l    Mon Nov 13 21:23:17 1989
  977. X***************
  978. X*** 1,10 ****
  979. X  %{
  980. X! /*    SCCS Id: @(#)lev_lex.c    3.0    89/07/02
  981. X  /*    Copyright (c) 1989 by Jean-Christophe Collet */
  982. X  /* NetHack may be freely redistributed.  See license for details. */
  983. X  
  984. X  #define LEV_LEX_C
  985. X  
  986. X  #include "hack.h"
  987. X  #include "lev_comp.h"
  988. X  #include "sp_lev.h"
  989. X--- 1,14 ----
  990. X  %{
  991. X! /*    SCCS Id: @(#)lev_lex.c    3.0    89/11/08
  992. X  /*    Copyright (c) 1989 by Jean-Christophe Collet */
  993. X  /* NetHack may be freely redistributed.  See license for details. */
  994. X  
  995. X  #define LEV_LEX_C
  996. X  
  997. X+ /* block some unused #defines to avoid overloading some cpp's */
  998. X+ #define MONDATA_H
  999. X+ #define MONFLAG_H
  1000. X+ 
  1001. X  #include "hack.h"
  1002. X  #include "lev_comp.h"
  1003. X  #include "sp_lev.h"
  1004. X***************
  1005. X*** 13,18 ****
  1006. X--- 17,30 ----
  1007. X  #undef exit
  1008. X  #endif
  1009. X  
  1010. X+ #ifdef TOS
  1011. X+ extern YYSTYPE yylval;    /* this doesn't always get put in lev_comp.h */
  1012. X+ #endif
  1013. X+ 
  1014. X+ #ifdef MACOS
  1015. X+ #undef putchar
  1016. X+ #undef putc
  1017. X+ #endif
  1018. X  int line_number = 1;
  1019. X  
  1020. X  /* This is *** UGLY *** but I can't think a better way to do it
  1021. X***************
  1022. X*** 25,42 ****
  1023. X  %}
  1024. X  %s MAPC
  1025. X  %%
  1026. X- ^#.*\n        { line_number++; }
  1027. X- MAZE        return MAZE_ID;
  1028. X- LEVEL        return LEVEL_ID;
  1029. X- GEOMETRY    return GEOMETRY_ID;
  1030. X- ^MAP\n        { BEGIN MAPC; }
  1031. X  <MAPC>[-|}{+SK\\#. ]*\n    { line_number++; yymore(); }    
  1032. X  <MAPC>ENDMAP\n    { BEGIN 0;
  1033. X            yytext[yyleng-7] = 0; /* Discard \nENDMAP */
  1034. X            yylval.map = (char *) alloc(strlen(yytext)+1);
  1035. X!           strcpy(yylval.map, yytext+1);
  1036. X            return MAP_ID;
  1037. X          }
  1038. X  OBJECT        return OBJECT_ID;
  1039. X  MONSTER        return MONSTER_ID;
  1040. X  TRAP        return TRAP_ID;
  1041. X--- 37,55 ----
  1042. X  %}
  1043. X  %s MAPC
  1044. X  %%
  1045. X  <MAPC>[-|}{+SK\\#. ]*\n    { line_number++; yymore(); }    
  1046. X  <MAPC>ENDMAP\n    { BEGIN 0;
  1047. X+           line_number++;
  1048. X            yytext[yyleng-7] = 0; /* Discard \nENDMAP */
  1049. X            yylval.map = (char *) alloc(strlen(yytext)+1);
  1050. X!           strcpy(yylval.map, yytext);
  1051. X            return MAP_ID;
  1052. X          }
  1053. X+ ^#.*\n        { line_number++; }
  1054. X+ MAZE        return MAZE_ID;
  1055. X+ LEVEL        return LEVEL_ID;
  1056. X+ GEOMETRY    return GEOMETRY_ID;
  1057. X+ ^MAP\n        { BEGIN MAPC; line_number++; }
  1058. X  OBJECT        return OBJECT_ID;
  1059. X  MONSTER        return MONSTER_ID;
  1060. X  TRAP        return TRAP_ID;
  1061. X*** src/Old/lev_comp.y    Sun Nov 19 12:45:08 1989
  1062. X--- src/lev_comp.y    Tue Nov 14 20:32:34 1989
  1063. X***************
  1064. X*** 10,15 ****
  1065. X--- 10,17 ----
  1066. X  
  1067. X  /* block some unused #defines to avoid overloading some cpp's */
  1068. X  #define MONDATA_H
  1069. X+ #define MONFLAG_H
  1070. X+ 
  1071. X  #include "hack.h"
  1072. X  #include "sp_lev.h"
  1073. X  #ifndef O_WRONLY
  1074. X***************
  1075. X*** 33,38 ****
  1076. X--- 35,46 ----
  1077. X  # undef exit
  1078. X  #endif
  1079. X  
  1080. X+ #ifdef MACOS
  1081. X+ # undef printf
  1082. X+ # undef Printf
  1083. X+ # define Printf printf
  1084. X+ #endif
  1085. X+ 
  1086. X  #define MAX_REGISTERS    10
  1087. X  #define ERR        (-1)
  1088. X  
  1089. X***************
  1090. X*** 109,115 ****
  1091. X  static altar *tmpaltar[256];
  1092. X  #endif /* ALTARS /**/
  1093. X  static lad *tmplad[256];
  1094. X! static dig *tmpdig[256];
  1095. X  static char *tmpmap[ROWNO];
  1096. X  static region *tmpreg[16];
  1097. X  static door *tmpdoor[256];
  1098. X--- 117,123 ----
  1099. X  static altar *tmpaltar[256];
  1100. X  #endif /* ALTARS /**/
  1101. X  static lad *tmplad[256];
  1102. X! static digpos *tmpdig[256];
  1103. X  static char *tmpmap[ROWNO];
  1104. X  static region *tmpreg[16];
  1105. X  static door *tmpdoor[256];
  1106. X***************
  1107. X*** 153,163 ****
  1108. X  %token    <i> MAZE_ID LEVEL_ID GEOMETRY_ID
  1109. X  %token    <i> OBJECT_ID MONSTER_ID TRAP_ID DOOR_ID DRAWBRIDGE_ID MAZEWALK_ID
  1110. X  %token    <i> REGION_ID RANDOM_OBJECTS_ID RANDOM_MONSTERS_ID RANDOM_PLACES_ID
  1111. X! %token    <i> ALTAR_ID LADDER_ID NON_DIGGABLE_ID ROOM_ID 
  1112. X  %token    <i> DOOR_STATE LIGHT_STATE
  1113. X  %token    <i> DIRECTION RANDOM_TYPE O_REGISTER M_REGISTER P_REGISTER A_REGISTER
  1114. X  %token    <i> ALIGNMENT LEFT_OR_RIGHT CENTER TOP_OR_BOT ALTAR_TYPE UP_OR_DOWN
  1115. X! %token  <i> ',' ':' '(' ')' '[' ']'
  1116. X  %token    <map> STRING MAP_ID
  1117. X  %type    <map> string maze_def m_name o_name
  1118. X  %start    file
  1119. X--- 161,171 ----
  1120. X  %token    <i> MAZE_ID LEVEL_ID GEOMETRY_ID
  1121. X  %token    <i> OBJECT_ID MONSTER_ID TRAP_ID DOOR_ID DRAWBRIDGE_ID MAZEWALK_ID
  1122. X  %token    <i> REGION_ID RANDOM_OBJECTS_ID RANDOM_MONSTERS_ID RANDOM_PLACES_ID
  1123. X! %token    <i> ALTAR_ID LADDER_ID NON_DIGGABLE_ID ROOM_ID
  1124. X  %token    <i> DOOR_STATE LIGHT_STATE
  1125. X  %token    <i> DIRECTION RANDOM_TYPE O_REGISTER M_REGISTER P_REGISTER A_REGISTER
  1126. X  %token    <i> ALIGNMENT LEFT_OR_RIGHT CENTER TOP_OR_BOT ALTAR_TYPE UP_OR_DOWN
  1127. X! %token    <i> ',' ':' '(' ')' '[' ']'
  1128. X  %token    <map> STRING MAP_ID
  1129. X  %type    <map> string maze_def m_name o_name
  1130. X  %start    file
  1131. X***************
  1132. X*** 179,187 ****
  1133. X                    fprintf(stderr,"%s : %d errors detected. No output created!\n", fname, fatal_error);
  1134. X                else {
  1135. X                    fout = open($1, O_WRONLY | O_CREAT
  1136. X! #ifdef MSDOS
  1137. X                            | O_BINARY
  1138. X! #endif /* MSDOS */
  1139. X                            , 0644);
  1140. X                    if (fout < 0) {
  1141. X                        yyerror("Can't open output file!!");
  1142. X--- 187,195 ----
  1143. X                    fprintf(stderr,"%s : %d errors detected. No output created!\n", fname, fatal_error);
  1144. X                else {
  1145. X                    fout = open($1, O_WRONLY | O_CREAT
  1146. X! #if defined(MSDOS) || defined(MACOS)
  1147. X                            | O_BINARY
  1148. X! #endif /* MSDOS || MACOS */
  1149. X                            , 0644);
  1150. X                    if (fout < 0) {
  1151. X                        yyerror("Can't open output file!!");
  1152. X***************
  1153. X*** 202,211 ****
  1154. X                $$ = $3;
  1155. X            }
  1156. X  
  1157. X! regions        : aregion
  1158. X          | regions aregion;
  1159. X  
  1160. X! aregion        : map_definition reg_init map_details
  1161. X            {
  1162. X              store_part();
  1163. X            }
  1164. X--- 210,219 ----
  1165. X                $$ = $3;
  1166. X            }
  1167. X  
  1168. X! regions     : aregion
  1169. X          | regions aregion;
  1170. X  
  1171. X! aregion     : map_definition reg_init map_details
  1172. X            {
  1173. X              store_part();
  1174. X            }
  1175. X***************
  1176. X*** 341,347 ****
  1177. X                if (!$5)
  1178. X                    tmpmonst[nmons]->id = -1;
  1179. X                else {
  1180. X!                   token = get_monster_id($5, (char) $<i>3);  
  1181. X                    if (token == ERR) {
  1182. X                        yywarning("Illegal monster name!  Making random monster.");
  1183. X                        tmpmonst[nmons]->id = -1;
  1184. X--- 349,355 ----
  1185. X                if (!$5)
  1186. X                    tmpmonst[nmons]->id = -1;
  1187. X                else {
  1188. X!                   token = get_monster_id($5, (char) $<i>3);
  1189. X                    if (token == ERR) {
  1190. X                        yywarning("Illegal monster name!  Making random monster.");
  1191. X                        tmpmonst[nmons]->id = -1;
  1192. X***************
  1193. X*** 405,411 ****
  1194. X              ndb++;
  1195. X             }
  1196. X  
  1197. X! mazewalk_detail    : MAZEWALK_ID ':' coordinate ',' DIRECTION
  1198. X            {
  1199. X              tmpwalk[nwalk] = (walk *) alloc(sizeof(walk));
  1200. X              tmpwalk[nwalk]->x = current_coord.x;
  1201. X--- 413,419 ----
  1202. X              ndb++;
  1203. X             }
  1204. X  
  1205. X! mazewalk_detail : MAZEWALK_ID ':' coordinate ',' DIRECTION
  1206. X            {
  1207. X              tmpwalk[nwalk] = (walk *) alloc(sizeof(walk));
  1208. X              tmpwalk[nwalk]->x = current_coord.x;
  1209. X***************
  1210. X*** 423,431 ****
  1211. X              nlad++;
  1212. X            }
  1213. X  
  1214. X! diggable_detail    : NON_DIGGABLE_ID ':' region
  1215. X            {
  1216. X!             tmpdig[ndig] = (dig *) alloc(sizeof(dig));
  1217. X              tmpdig[ndig]->x1 = current_region.x1;
  1218. X              tmpdig[ndig]->y1 = current_region.y1;
  1219. X              tmpdig[ndig]->x2 = current_region.x2;
  1220. X--- 431,439 ----
  1221. X              nlad++;
  1222. X            }
  1223. X  
  1224. X! diggable_detail : NON_DIGGABLE_ID ':' region
  1225. X            {
  1226. X!             tmpdig[ndig] = (digpos *) alloc(sizeof(digpos));
  1227. X              tmpdig[ndig]->x1 = current_region.x1;
  1228. X              tmpdig[ndig]->y1 = current_region.y1;
  1229. X              tmpdig[ndig]->x2 = current_region.x2;
  1230. X***************
  1231. X*** 487,493 ****
  1232. X  
  1233. X  trap_name    : string
  1234. X            {
  1235. X!               int token = get_trap_type($1);
  1236. X              if (token == ERR)
  1237. X                  yyerror("unknown trap type!");
  1238. X              $<i>$ = token;
  1239. X--- 495,501 ----
  1240. X  
  1241. X  trap_name    : string
  1242. X            {
  1243. X!             int token = get_trap_type($1);
  1244. X              if (token == ERR)
  1245. X                  yyerror("unknown trap type!");
  1246. X              $<i>$ = token;
  1247. X***************
  1248. X*** 537,543 ****
  1249. X              }
  1250. X            }
  1251. X  
  1252. X! o_register    : O_REGISTER '[' INTEGER ']' 
  1253. X            {
  1254. X              if ( $3 >= MAX_REGISTERS ) {
  1255. X                  yyerror("Register Index overflow!");
  1256. X--- 545,551 ----
  1257. X              }
  1258. X            }
  1259. X  
  1260. X! o_register    : O_REGISTER '[' INTEGER ']'
  1261. X            {
  1262. X              if ( $3 >= MAX_REGISTERS ) {
  1263. X                  yyerror("Register Index overflow!");
  1264. X***************
  1265. X*** 566,572 ****
  1266. X  
  1267. X  place        : coord
  1268. X  
  1269. X! monster        : CHAR
  1270. X            {
  1271. X              if (check_monster_char($1))
  1272. X                  $<i>$ = $1 ;
  1273. X--- 574,580 ----
  1274. X  
  1275. X  place        : coord
  1276. X  
  1277. X! monster     : CHAR
  1278. X            {
  1279. X              if (check_monster_char($1))
  1280. X                  $<i>$ = $1 ;
  1281. X***************
  1282. X*** 598,604 ****
  1283. X  
  1284. X  coord        : '(' INTEGER ',' INTEGER ')'
  1285. X            {
  1286. X!                 if ($2 < 0 || $2 > max_x_map ||
  1287. X                  $4 < 0 || $4 > max_y_map)
  1288. X                  yyerror("Coordinates out of map range!");
  1289. X              current_coord.x = $2;
  1290. X--- 606,612 ----
  1291. X  
  1292. X  coord        : '(' INTEGER ',' INTEGER ')'
  1293. X            {
  1294. X!             if ($2 < 0 || $2 > max_x_map ||
  1295. X                  $4 < 0 || $4 > max_y_map)
  1296. X                  yyerror("Coordinates out of map range!");
  1297. X              current_coord.x = $2;
  1298. X***************
  1299. X*** 607,613 ****
  1300. X  
  1301. X  region        : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'
  1302. X            {
  1303. X!                 if ($2 < 0 || $2 > max_x_map ||
  1304. X                  $4 < 0 || $4 > max_y_map ||
  1305. X                  $6 < 0 || $6 > max_x_map ||
  1306. X                  $8 < 0 || $8 > max_y_map)
  1307. X--- 615,621 ----
  1308. X  
  1309. X  region        : '(' INTEGER ',' INTEGER ',' INTEGER ',' INTEGER ')'
  1310. X            {
  1311. X!             if ($2 < 0 || $2 > max_x_map ||
  1312. X                  $4 < 0 || $4 > max_y_map ||
  1313. X                  $6 < 0 || $6 > max_x_map ||
  1314. X                  $8 < 0 || $8 > max_y_map)
  1315. X***************
  1316. X*** 894,900 ****
  1317. X      /* The non_diggable directives */
  1318. X  
  1319. X      if(tmppart[npart]->ndig = ndig) {
  1320. X!         tmppart[npart]->digs = (dig **) alloc(sizeof(dig*) * ndig);
  1321. X          for(i=0;i<ndig;i++)
  1322. X              tmppart[npart]->digs[i] = tmpdig[i];
  1323. X      }
  1324. X--- 902,908 ----
  1325. X      /* The non_diggable directives */
  1326. X  
  1327. X      if(tmppart[npart]->ndig = ndig) {
  1328. X!         tmppart[npart]->digs = (digpos **) alloc(sizeof(digpos*) * ndig);
  1329. X          for(i=0;i<ndig;i++)
  1330. X              tmppart[npart]->digs[i] = tmpdig[i];
  1331. X      }
  1332. X***************
  1333. X*** 1039,1045 ****
  1334. X          /* The non_diggable directives */
  1335. X          (void) write(fd, &(pt->ndig), 1);
  1336. X          for(j=0;j<pt->ndig;j++) {
  1337. X!             (void) write(fd,(genericptr_t) pt->digs[j], sizeof(dig));
  1338. X              free(pt->digs[j]);
  1339. X          }
  1340. X          if (pt->ndig > 0)
  1341. X--- 1047,1053 ----
  1342. X          /* The non_diggable directives */
  1343. X          (void) write(fd, &(pt->ndig), 1);
  1344. X          for(j=0;j<pt->ndig;j++) {
  1345. X!             (void) write(fd,(genericptr_t) pt->digs[j], sizeof(digpos));
  1346. X              free(pt->digs[j]);
  1347. X          }
  1348. X          if (pt->ndig > 0)
  1349. X*** src/Old/lev_main.c    Sun Nov 19 12:46:16 1989
  1350. X--- src/lev_main.c    Sat Nov 11 17:29:56 1989
  1351. X***************
  1352. X*** 7,12 ****
  1353. X--- 7,13 ----
  1354. X   * and some useful functions needed by yacc
  1355. X   */
  1356. X  
  1357. X+ /* #include "hack.h"    /* uncomment for the Mac */
  1358. X  #include <stdio.h>
  1359. X  
  1360. X  #define MAX_ERRORS    25
  1361. X***************
  1362. X*** 21,26 ****
  1363. X--- 22,76 ----
  1364. X  {
  1365. X      FILE *fin;
  1366. X      int i;
  1367. X+ 
  1368. X+ #if defined(MACOS) && defined(SMALLDATA)
  1369. X+ # ifdef THINKC4
  1370. X+ #include <console.h>
  1371. X+ # endif
  1372. X+ #define YYLMAX    2048
  1373. X+     extern char    *yysbuf, *yytext, *yysptr;
  1374. X+     Handle temp;
  1375. X+     Str255 name;
  1376. X+     long    j;
  1377. X+     extern struct permonst *mons;
  1378. X+     extern struct objclass *objects;
  1379. X+ 
  1380. X+     /* sub in the Nethack resource filename */
  1381. X+     strcpy((char *)name, "\010NH3.rsrc");
  1382. X+     yysbuf = (char *)alloc(YYLMAX);
  1383. X+     yysptr = yysbuf;
  1384. X+     yytext = (char *)alloc(YYLMAX);
  1385. X+ 
  1386. X+     (void)OpenResFile(name);
  1387. X+     temp = GetResource(HACK_DATA, MONST_DATA);
  1388. X+     if (temp) {
  1389. X+         DetachResource(temp);
  1390. X+         MoveHHi(temp);
  1391. X+         HLock(temp);
  1392. X+         i = GetHandleSize(temp);
  1393. X+         mons = (struct permonst *)(*temp);
  1394. X+     } else {
  1395. X+         panic("Can't get MONST resource data.");
  1396. X+     }
  1397. X+     
  1398. X+     temp = GetResource(HACK_DATA, OBJECT_DATA);
  1399. X+     if (temp) {
  1400. X+         DetachResource(temp);
  1401. X+         MoveHHi(temp);
  1402. X+         HLock(temp);
  1403. X+         i = GetHandleSize(temp);
  1404. X+         objects = (struct objclass *)(*temp);
  1405. X+         for (j = 0; j< NROFOBJECTS+1; j++) {
  1406. X+             objects[j].oc_name = sm_obj[j].oc_name;
  1407. X+             objects[j].oc_descr = sm_obj[j].oc_descr;
  1408. X+         }
  1409. X+     } else {
  1410. X+         panic("Can't get OBJECT resource data.");
  1411. X+     }
  1412. X+ # ifdef THINKC4
  1413. X+     argc = ccommand(&argv);
  1414. X+ # endif
  1415. X+ #endif
  1416. X  
  1417. X      if (argc == 1)        /* Read standard input */
  1418. X          yyparse();
  1419. X*** src/Old/lock.c    Sun Nov 19 12:46:30 1989
  1420. X--- src/lock.c    Sat Nov 11 17:29:37 1989
  1421. X***************
  1422. X*** 11,17 ****
  1423. X--- 11,19 ----
  1424. X      int chance, usedtime;
  1425. X  } xlock;
  1426. X  
  1427. X+ #ifndef OVERLAY
  1428. X  static
  1429. X+ #endif
  1430. X  int
  1431. X  picklock() {    /* try to open/close a lock */
  1432. X  
  1433. X***************
  1434. X*** 59,64 ****
  1435. X--- 61,68 ----
  1436. X          if(xlock.door->doormask & D_TRAPPED) {
  1437. X              b_trapped("door");
  1438. X              xlock.door->doormask = D_NODOOR;
  1439. X+             mnewsym(u.ux+u.dx, u.uy+u.dy);
  1440. X+             prl(u.ux+u.dx, u.uy+u.dy);
  1441. X          } else if(xlock.door->doormask == D_LOCKED)
  1442. X          xlock.door->doormask = D_CLOSED;
  1443. X          else xlock.door->doormask = D_LOCKED;
  1444. X***************
  1445. X*** 72,78 ****
  1446. X      return((xlock.usedtime = 0));
  1447. X  }
  1448. X  
  1449. X! static
  1450. X  int
  1451. X  forcelock() {    /* try to force a locked chest */
  1452. X  
  1453. X--- 76,84 ----
  1454. X      return((xlock.usedtime = 0));
  1455. X  }
  1456. X  
  1457. X! #ifndef OVERLAY
  1458. X! static 
  1459. X! #endif
  1460. X  int
  1461. X  forcelock() {    /* try to force a locked chest */
  1462. X  
  1463. X***************
  1464. X*** 182,227 ****
  1465. X      y = u.uy + u.dy;
  1466. X      if((x == u.ux) && (y == u.uy)) { /* pick the lock on a container */
  1467. X          c = 'n';            /* in case there are no boxes here */
  1468. X!         if(OBJ_AT(x, y))
  1469. X!         for(otmp = fobj; otmp; otmp = otmp->nobj)
  1470. X!         if((otmp->ox == x) && (otmp->oy == y))
  1471. X!             if(Is_box(otmp) &&
  1472. X!                /* credit cards are only good for unlocking */
  1473. X!                (picktyp != CREDIT_CARD || otmp->olocked)) {
  1474. X!             pline("There is %s here, %s the lock? ",
  1475. X!             doname(otmp), (!otmp->olocked) ? "close" :
  1476. X!             ((picktyp == LOCK_PICK) ? "pick" : "open" ));
  1477. X! 
  1478. X!             c = ynq();
  1479. X!             if(c == 'q') return(0);
  1480. X!             if(c == 'n') continue;
  1481. X! 
  1482. X!             if(picktyp == KEY && otmp->spe != pick->spe) {
  1483. X!                 pline("The %s won't fit the lock.",xname(pick));
  1484. X!                 return(1);
  1485. X!             }
  1486. X!             switch(picktyp) {
  1487. X!                 case CREDIT_CARD:
  1488. X!                 ch = ACURR(A_DEX)+(20*(pl_character[0] == 'R'));
  1489. X!                 break;
  1490. X!                 case LOCK_PICK:
  1491. X!                 ch = 4*ACURR(A_DEX)+(25*(pl_character[0] == 'R'));
  1492. X!                 break;
  1493. X!                 case SKELETON_KEY:
  1494. X!                 ch = 75 + ACURR(A_DEX);
  1495. X!                 break;
  1496. X!                 case KEY:
  1497. X!                 ch = 1000;
  1498. X!                 break;
  1499. X!                 default:    ch = 0;
  1500. X!             }
  1501. X!             if(otmp->cursed) ch /= 2;
  1502. X  
  1503. X!             xlock.door_or_box = 0;
  1504. X!             xlock.picktyp = picktyp;
  1505. X!             xlock.box = otmp;
  1506. X!             break;
  1507. X              }
  1508. X          if(c != 'y')
  1509. X          return(0);        /* decided against all boxes */
  1510. X      } else {            /* pick the lock in a door */
  1511. X--- 188,231 ----
  1512. X      y = u.uy + u.dy;
  1513. X      if((x == u.ux) && (y == u.uy)) { /* pick the lock on a container */
  1514. X          c = 'n';            /* in case there are no boxes here */
  1515. X!         for(otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere)
  1516. X!         if(Is_box(otmp) &&
  1517. X!                    /* credit cards are only good for unlocking */
  1518. X!                    (picktyp != CREDIT_CARD || otmp->olocked)) {
  1519. X!             pline("There is %s here, %s the lock? ",
  1520. X!             doname(otmp), (!otmp->olocked) ? "close" :
  1521. X!             ((picktyp == LOCK_PICK) ? "pick" : "open" ));
  1522. X! 
  1523. X!             c = ynq();
  1524. X!             if(c == 'q') return(0);
  1525. X!             if(c == 'n') continue;
  1526. X  
  1527. X!             if(picktyp == KEY && otmp->spe != pick->spe) {
  1528. X!                 pline("The %s won't fit the lock.",xname(pick));
  1529. X!                 return(1);
  1530. X!             }
  1531. X!             switch(picktyp) {
  1532. X!             case CREDIT_CARD:
  1533. X!                 ch = ACURR(A_DEX)+(20*(pl_character[0] == 'R'));
  1534. X!                 break;
  1535. X!             case LOCK_PICK:
  1536. X!                 ch = 4*ACURR(A_DEX)+(25*(pl_character[0] == 'R'));
  1537. X!                 break;
  1538. X!             case SKELETON_KEY:
  1539. X!                 ch = 75 + ACURR(A_DEX);
  1540. X!                 break;
  1541. X!             case KEY:
  1542. X!                 ch = 1000;
  1543. X!                 break;
  1544. X!             default:    ch = 0;
  1545. X              }
  1546. X+             if(otmp->cursed) ch /= 2;
  1547. X+ 
  1548. X+             xlock.door_or_box = 0;
  1549. X+             xlock.picktyp = picktyp;
  1550. X+             xlock.box = otmp;
  1551. X+             break;
  1552. X+         }
  1553. X          if(c != 'y')
  1554. X          return(0);        /* decided against all boxes */
  1555. X      } else {            /* pick the lock in a door */
  1556. X***************
  1557. X*** 329,360 ****
  1558. X  
  1559. X      /* A lock is made only for the honest man, the thief will break it. */
  1560. X      xlock.box = (struct obj *)0;
  1561. X!     if(OBJ_AT(u.ux, u.uy))
  1562. X!     for(otmp = fobj; otmp; otmp = otmp->nobj)
  1563. X!         if((otmp->ox == u.ux) && (otmp->oy == u.uy))
  1564. X!         if(Is_box(otmp)) {
  1565. X!           if(otmp->olocked)
  1566. X              pline("There is %s here, force the lock? ", doname(otmp));
  1567. X!           else {
  1568. X              pline("There is a %s here, but it's already unlocked.",
  1569. X                xname(otmp));
  1570. X              continue;
  1571. X!           }
  1572. X  
  1573. X!           c = ynq();
  1574. X!           if(c == 'q') return(0);
  1575. X!           if(c == 'n') continue;
  1576. X  
  1577. X!           if(picktyp)
  1578. X              You("force your %s into a crack and pry.", xname(uwep));
  1579. X!           else
  1580. X              You("start bashing it with your %s.", xname(uwep));
  1581. X!           xlock.box = otmp;
  1582. X!           xlock.chance = objects[otmp->otyp].wldam * 2;
  1583. X!           xlock.picktyp = picktyp;
  1584. X!           xlock.usedtime = 0;
  1585. X!           break;
  1586. X!         }
  1587. X  
  1588. X      if(xlock.box)    set_occupation(forcelock, "forcing the lock", 0);
  1589. X      else        You("decide not to force the issue.");
  1590. X--- 333,362 ----
  1591. X  
  1592. X      /* A lock is made only for the honest man, the thief will break it. */
  1593. X      xlock.box = (struct obj *)0;
  1594. X!     for(otmp = level.objects[u.ux][u.uy]; otmp; otmp = otmp->nexthere)
  1595. X!         if(Is_box(otmp)) {
  1596. X!         if(otmp->olocked)
  1597. X              pline("There is %s here, force the lock? ", doname(otmp));
  1598. X!         else {
  1599. X              pline("There is a %s here, but it's already unlocked.",
  1600. X                xname(otmp));
  1601. X              continue;
  1602. X!         }
  1603. X  
  1604. X!         c = ynq();
  1605. X!         if(c == 'q') return(0);
  1606. X!         if(c == 'n') continue;
  1607. X  
  1608. X!         if(picktyp)
  1609. X              You("force your %s into a crack and pry.", xname(uwep));
  1610. X!         else
  1611. X              You("start bashing it with your %s.", xname(uwep));
  1612. X!         xlock.box = otmp;
  1613. X!         xlock.chance = objects[otmp->otyp].wldam * 2;
  1614. X!         xlock.picktyp = picktyp;
  1615. X!         xlock.usedtime = 0;
  1616. X!         break;
  1617. X!         }
  1618. X  
  1619. X      if(xlock.box)    set_occupation(forcelock, "forcing the lock", 0);
  1620. X      else        You("decide not to force the issue.");
  1621. X***************
  1622. X*** 374,380 ****
  1623. X      if((x == u.ux) && (y == u.uy)) return(0);
  1624. X  
  1625. X      if(MON_AT(x, y) && (mtmp = m_at(x,y))->mimic && 
  1626. X!                 mtmp->mappearance == DOOR_SYM &&
  1627. X                  !Protection_from_shape_changers) {
  1628. X          stumble_onto_mimic(mtmp);
  1629. X          return(1);
  1630. X--- 376,382 ----
  1631. X      if((x == u.ux) && (y == u.uy)) return(0);
  1632. X  
  1633. X      if(MON_AT(x, y) && (mtmp = m_at(x,y))->mimic && 
  1634. X!                 mtmp->mappearance == CLOSED_DOOR_SYM &&
  1635. X                  !Protection_from_shape_changers) {
  1636. X          stumble_onto_mimic(mtmp);
  1637. X          return(1);
  1638. X***************
  1639. X*** 418,423 ****
  1640. X--- 420,427 ----
  1641. X          door->doormask = D_NODOOR;
  1642. X          } else
  1643. X          door->doormask = D_ISOPEN;
  1644. X+         mnewsym(x,y);
  1645. X+         prl(x,y);
  1646. X      } else {
  1647. X          pline("The door resists!");
  1648. X      }
  1649. X***************
  1650. X*** 460,466 ****
  1651. X      }
  1652. X  
  1653. X      if(MON_AT(x, y) && (mtmp = m_at(x,y))->mimic && 
  1654. X!                 mtmp->mappearance == DOOR_SYM &&
  1655. X                  !Protection_from_shape_changers) {
  1656. X          stumble_onto_mimic(mtmp);
  1657. X          return(1);
  1658. X--- 464,470 ----
  1659. X      }
  1660. X  
  1661. X      if(MON_AT(x, y) && (mtmp = m_at(x,y))->mimic && 
  1662. X!                 mtmp->mappearance == CLOSED_DOOR_SYM &&
  1663. X                  !Protection_from_shape_changers) {
  1664. X          stumble_onto_mimic(mtmp);
  1665. X          return(1);
  1666. X***************
  1667. X*** 506,511 ****
  1668. X--- 510,517 ----
  1669. X          if (rn2(25) < (ACURR(A_STR)+ACURR(A_DEX)+ACURR(A_CON))/3) {
  1670. X          pline("The door closes.");
  1671. X          door->doormask = D_CLOSED;
  1672. X+         mnewsym(x,y);
  1673. X+         prl(x,y);
  1674. X          }
  1675. X          else pline("The door resists!");
  1676. X      }
  1677. X***************
  1678. X*** 561,570 ****
  1679. X            ) {
  1680. X          door->typ = DOOR;
  1681. X          door->doormask = D_CLOSED | (door->doormask & D_TRAPPED);
  1682. X!         if(cansee(x,y)) {
  1683. X!             pline("A section of the wall opens up!");
  1684. X!             newsym(x,y);
  1685. X!         }
  1686. X          return(1);
  1687. X          } else
  1688. X          return(0);
  1689. X--- 567,574 ----
  1690. X            ) {
  1691. X          door->typ = DOOR;
  1692. X          door->doormask = D_CLOSED | (door->doormask & D_TRAPPED);
  1693. X!         if(cansee(x,y)) pline("A section of the wall opens up!");
  1694. X!         mnewsym(x,y);
  1695. X          return(1);
  1696. X          } else
  1697. X          return(0);
  1698. X***************
  1699. X*** 608,613 ****
  1700. X--- 612,619 ----
  1701. X              default: res = 0;
  1702. X          }
  1703. X          door->doormask = D_LOCKED | (door->doormask & D_TRAPPED);
  1704. X+         mnewsym(x,y);
  1705. X+         if(cansee(x,y)) prl(x,y);
  1706. X          break;
  1707. X          case WAN_OPENING:
  1708. X  #ifdef SPELLS
  1709. X***************
  1710. X*** 632,637 ****
  1711. X--- 638,645 ----
  1712. X                  else if (flags.soundok)
  1713. X                     You("hear a distant explosion.");
  1714. X              door->doormask = D_NODOOR;
  1715. X+             mnewsym(x,y);
  1716. X+             if (cansee(x,y)) prl(x,y);
  1717. X              break;
  1718. X              }
  1719. X              door->doormask = D_BROKEN;
  1720. X***************
  1721. X*** 640,645 ****
  1722. X--- 648,655 ----
  1723. X                  pline("The door crashes open!");
  1724. X              else if (flags.soundok)
  1725. X                  You("hear a crashing sound.");
  1726. X+             mnewsym(x,y);
  1727. X+             if (cansee(x,y)) prl(x,y);
  1728. X          } else res = 0;
  1729. X          break;
  1730. X          default:    impossible("magic (%d) attempted on door.", otmp->otyp);
  1731. X*** src/Old/makemon.c    Sun Nov 19 13:40:51 1989
  1732. X--- src/makemon.c    Fri Nov 17 19:31:44 1989
  1733. X***************
  1734. X*** 1,4 ****
  1735. X! /*    SCCS Id: @(#)makemon.c    3.0    88/04/11
  1736. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1737. X  /* NetHack may be freely redistributed.  See license for details. */
  1738. X  
  1739. X--- 1,4 ----
  1740. X! /*    SCCS Id: @(#)makemon.c    3.0    89/11/15
  1741. X  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  1742. X  /* NetHack may be freely redistributed.  See license for details. */
  1743. X  
  1744. X***************
  1745. X*** 5,16 ****
  1746. X  #include    "hack.h"
  1747. X  
  1748. X  struct monst zeromonst;
  1749. X! static int uncommon P((struct permonst *));
  1750. X  
  1751. X  int monstr[NUMMONS];
  1752. X  
  1753. X! #define m_initsgrp(mtmp, x, y) m_initgrp(mtmp, x, y, 3)
  1754. X! #define m_initlgrp(mtmp, x, y) m_initgrp(mtmp, x, y, 10)
  1755. X  #define toostrong(monindx, lev) (monstr[monindx] > lev)
  1756. X  #define tooweak(monindx, lev)    (monstr[monindx] < lev)
  1757. X  
  1758. X--- 5,16 ----
  1759. X  #include    "hack.h"
  1760. X  
  1761. X  struct monst zeromonst;
  1762. X! static int FDECL(uncommon, (struct permonst *));
  1763. X  
  1764. X  int monstr[NUMMONS];
  1765. X  
  1766. X! #define m_initsgrp(mtmp, x, y)    m_initgrp(mtmp, x, y, 3)
  1767. X! #define m_initlgrp(mtmp, x, y)    m_initgrp(mtmp, x, y, 10)
  1768. X  #define toostrong(monindx, lev) (monstr[monindx] > lev)
  1769. X  #define tooweak(monindx, lev)    (monstr[monindx] < lev)
  1770. X  
  1771. X***************
  1772. X*** 23,28 ****
  1773. X--- 23,35 ----
  1774. X      register int cnt = rnd(n);
  1775. X      struct monst *mon;
  1776. X  
  1777. X+ /*
  1778. X+  *    Temporary kludge to cut down on swarming at lower character levels
  1779. X+  *    till we can get this game a little more balanced. [mrs]
  1780. X+  */
  1781. X+     cnt /= (u.ulevel < 3) ? 4 : (u.ulevel < 5) ? 2 : 1;
  1782. X+     if(!cnt) cnt++;
  1783. X+ 
  1784. X      mm.x = x;
  1785. X      mm.y = y;
  1786. X      while(cnt--) {
  1787. X***************
  1788. X*** 64,69 ****
  1789. X--- 71,77 ----
  1790. X  register struct monst *mtmp;
  1791. X  {
  1792. X      register struct permonst *ptr = mtmp->data;
  1793. X+     register int mm = monsndx(ptr);
  1794. X  #ifdef REINCARNATION
  1795. X      if (dlevel==rogue_level) return;
  1796. X  #endif
  1797. X***************
  1798. X*** 84,90 ****
  1799. X          break;
  1800. X          case S_HUMAN:
  1801. X          if(is_mercenary(ptr))
  1802. X!             switch(monsndx(ptr)) {
  1803. X  
  1804. X  #ifdef ARMY
  1805. X              case PM_SOLDIER:
  1806. X--- 92,98 ----
  1807. X          break;
  1808. X          case S_HUMAN:
  1809. X          if(is_mercenary(ptr))
  1810. X!             switch (mm) {
  1811. X  
  1812. X  #ifdef ARMY
  1813. X              case PM_SOLDIER:
  1814. X***************
  1815. X*** 108,114 ****
  1816. X  
  1817. X          case S_HUMANOID:
  1818. X  #ifdef TOLKIEN
  1819. X!         if (monsndx(ptr) == PM_HOBBIT) {
  1820. X              switch (rn2(3)) {
  1821. X                case 0:
  1822. X                  (void)mongets(mtmp, DAGGER);
  1823. X--- 116,122 ----
  1824. X  
  1825. X          case S_HUMANOID:
  1826. X  #ifdef TOLKIEN
  1827. X!         if (mm == PM_HOBBIT) {
  1828. X              switch (rn2(3)) {
  1829. X                case 0:
  1830. X                  (void)mongets(mtmp, DAGGER);
  1831. X***************
  1832. X*** 201,253 ****
  1833. X          break;
  1834. X  #endif
  1835. X          case S_ORC:
  1836. X  #ifdef TOLKIEN
  1837. X!         { int mm = monsndx(ptr);
  1838. X!           if(rn2(2)) (void)mongets(mtmp, ORCISH_HELM);
  1839. X!           if (mm == PM_MORDOR_ORC ||
  1840. X!              (mm == PM_ORC_CAPTAIN && rn2(2))) {
  1841. X!               if(rn2(2)) (void)mongets(mtmp, SCIMITAR);
  1842. X!               if(rn2(2)) (void)mongets(mtmp, ORCISH_SHIELD);
  1843. X!               if(rn2(2)) (void)mongets(mtmp, KNIFE);
  1844. X!               if(rn2(2)) (void)mongets(mtmp, ORCISH_CHAIN_MAIL);
  1845. X!           } else if (mm == PM_URUK_HAI || mm == PM_ORC_CAPTAIN) {
  1846. X!               if(rn2(2)) (void)mongets(mtmp, ORCISH_CLOAK);
  1847. X!               if(rn2(2)) (void)mongets(mtmp, ORCISH_SHORT_SWORD);
  1848. X!               if(rn2(2)) (void)mongets(mtmp, IRON_SHOES);
  1849. X!               if(rn2(2)) {
  1850. X!               (void)mongets(mtmp, ORCISH_BOW);
  1851. X!               m_initthrow(mtmp, ORCISH_ARROW, 12);
  1852. X!               }
  1853. X!               if(rn2(2)) (void)mongets(mtmp, URUK_HAI_SHIELD);
  1854. X!           } else if (mm != PM_ORC_SHAMAN) {
  1855. X!               (void)mongets(mtmp, (mm == PM_GOBLIN || rn2(2) == 0) ?
  1856. X!                     ORCISH_DAGGER : SCIMITAR);
  1857. X!           }
  1858. X!         }
  1859. X  #else /* TOLKIEN */
  1860. X!         { int mm = monsndx(ptr);
  1861. X!           if(rn2(2)) (void)mongets(mtmp, ORCISH_HELM);
  1862. X!           if (mm == PM_ORC_CAPTAIN) {
  1863. X!               if(rn2(2)) {
  1864. X!               if(rn2(2)) (void)mongets(mtmp, SCIMITAR);
  1865. X!               if(rn2(2)) (void)mongets(mtmp, SMALL_SHIELD);
  1866. X!               if(rn2(2)) (void)mongets(mtmp, KNIFE);
  1867. X!               if(rn2(2)) (void)mongets(mtmp, CHAIN_MAIL);
  1868. X!               } else {
  1869. X!               if(rn2(2)) (void)mongets(mtmp, SHORT_SWORD);
  1870. X!               if(rn2(2)) (void)mongets(mtmp, IRON_SHOES);
  1871. X!               if(rn2(2)) {
  1872. X!                   (void)mongets(mtmp, BOW);
  1873. X!                   m_initthrow(mtmp, ARROW, 12);
  1874. X!               }
  1875. X!               if(rn2(2)) (void)mongets(mtmp, SMALL_SHIELD);
  1876. X!               }
  1877. X!           } else if (mm != PM_ORC_SHAMAN) {
  1878. X!               (void)mongets(mtmp, (mm == PM_GOBLIN || rn2(2) == 0) ?
  1879. X!                     DAGGER : SCIMITAR);
  1880. X!           }
  1881. X!         }
  1882. X  #endif /* TOLKIEN */
  1883. X          break;
  1884. X          case S_KOBOLD:
  1885. X          if (!rn2(4)) m_initthrow(mtmp, DART, 12);
  1886. X--- 209,261 ----
  1887. X          break;
  1888. X  #endif
  1889. X          case S_ORC:
  1890. X+         if(rn2(2)) (void)mongets(mtmp, ORCISH_HELM);
  1891. X  #ifdef TOLKIEN
  1892. X!         switch (mm != PM_ORC_CAPTAIN ? mm :
  1893. X!             rn2(2) ? PM_MORDOR_ORC : PM_URUK_HAI) {
  1894. X!             case PM_MORDOR_ORC:
  1895. X!             if(rn2(2)) (void)mongets(mtmp, SCIMITAR);
  1896. X!             if(rn2(2)) (void)mongets(mtmp, ORCISH_SHIELD);
  1897. X!             if(rn2(2)) (void)mongets(mtmp, KNIFE);
  1898. X!             if(rn2(2)) (void)mongets(mtmp, ORCISH_CHAIN_MAIL);
  1899. X!             break;
  1900. X!             case PM_URUK_HAI:
  1901. X!             if(rn2(2)) (void)mongets(mtmp, ORCISH_CLOAK);
  1902. X!             if(rn2(2)) (void)mongets(mtmp, ORCISH_SHORT_SWORD);
  1903. X!             if(rn2(2)) (void)mongets(mtmp, IRON_SHOES);
  1904. X!             if(rn2(2)) {
  1905. X!                 (void)mongets(mtmp, ORCISH_BOW);
  1906. X!                 m_initthrow(mtmp, ORCISH_ARROW, 12);
  1907. X!             }
  1908. X!             if(rn2(2)) (void)mongets(mtmp, URUK_HAI_SHIELD);
  1909. X!             break;
  1910. X!             default:
  1911. X!             if (mm != PM_ORC_SHAMAN)
  1912. X!               (void)mongets(mtmp, (mm == PM_GOBLIN || rn2(2) == 0) ?
  1913. X!                           ORCISH_DAGGER : SCIMITAR);
  1914. X  #else /* TOLKIEN */
  1915. X!         switch (mm) {
  1916. X!             case  PM_ORC_CAPTAIN:
  1917. X!             if(rn2(2)) {
  1918. X!                 if(rn2(2)) (void)mongets(mtmp, SCIMITAR);
  1919. X!                 if(rn2(2)) (void)mongets(mtmp, SMALL_SHIELD);
  1920. X!                 if(rn2(2)) (void)mongets(mtmp, KNIFE);
  1921. X!                 if(rn2(2)) (void)mongets(mtmp, CHAIN_MAIL);
  1922. X!             } else {
  1923. X!                 if(rn2(2)) (void)mongets(mtmp, SHORT_SWORD);
  1924. X!                 if(rn2(2)) (void)mongets(mtmp, IRON_SHOES);
  1925. X!                 if(rn2(2)) {
  1926. X!                 (void)mongets(mtmp, BOW);
  1927. X!                 m_initthrow(mtmp, ARROW, 12);
  1928. X!                 }
  1929. X!                 if(rn2(2)) (void)mongets(mtmp, SMALL_SHIELD);
  1930. X!             }
  1931. X!             default:
  1932. X!             if (mm != PM_ORC_SHAMAN)
  1933. X!               (void)mongets(mtmp, (mm == PM_GOBLIN || rn2(2) == 0) ?
  1934. X!                           DAGGER : SCIMITAR);
  1935. X  #endif /* TOLKIEN */
  1936. X+         }
  1937. X          break;
  1938. X          case S_KOBOLD:
  1939. X          if (!rn2(4)) m_initthrow(mtmp, DART, 12);
  1940. X***************
  1941. X*** 269,279 ****
  1942. X          (void)mongets(mtmp, LONG_SWORD);
  1943. X          break;
  1944. X          case S_DEMON:
  1945. X! #ifdef HARD
  1946. X!         if (monsndx(ptr) == PM_BALROG) {
  1947. X!             (void)mongets(mtmp, BULLWHIP);
  1948. X!             (void)mongets(mtmp, BROADSWORD);
  1949. X!             break;
  1950. X          }
  1951. X  #endif
  1952. X          /* prevent djinnis and mail daemons from leaving objects when
  1953. X--- 277,306 ----
  1954. X          (void)mongets(mtmp, LONG_SWORD);
  1955. X          break;
  1956. X          case S_DEMON:
  1957. X! #ifdef INFERNO
  1958. X!         switch (mm) {
  1959. X!             case PM_BALROG:
  1960. X!             (void)mongets(mtmp, BULLWHIP);
  1961. X!             (void)mongets(mtmp, BROADSWORD);
  1962. X!             break;
  1963. X!             case PM_ORCUS:
  1964. X!             (void)mongets(mtmp, WAN_DEATH); /* the Wand of Orcus */
  1965. X!             break;
  1966. X!             case PM_HORNED_DEVIL:
  1967. X!             (void)mongets(mtmp, rn2(4) ? TRIDENT : BULLWHIP);
  1968. X!             break;
  1969. X!             case PM_ICE_DEVIL:
  1970. X!             if (!rn2(4)) (void)mongets(mtmp, SPEAR);
  1971. X!             break;
  1972. X!             case PM_ASMODEUS:
  1973. X!             (void)mongets(mtmp, WAN_COLD);
  1974. X!             break;
  1975. X!             case PM_DISPATER:
  1976. X!             (void)mongets(mtmp, WAN_STRIKING);
  1977. X!             break;
  1978. X!             case PM_YEENOGHU:
  1979. X!             (void)mongets(mtmp, FLAIL);
  1980. X!             break;
  1981. X          }
  1982. X  #endif
  1983. X          /* prevent djinnis and mail daemons from leaving objects when
  1984. X***************
  1985. X*** 504,520 ****
  1986. X              if(OBJ_AT(x, y) || levl[x][y].gmask)
  1987. X                  mtmp->mundetected = 1;
  1988. X              break;
  1989. X-         case S_CHAMELEON:
  1990. X-             /* If you're protected with a ring, don't create
  1991. X-              * any shape-changing chameleons -dgk
  1992. X-              */
  1993. X-             if (Protection_from_shape_changers)
  1994. X-                 mtmp->cham = 0;
  1995. X-             else {
  1996. X-                 mtmp->cham = 1;
  1997. X-                 (void) newcham(mtmp, rndmonst());
  1998. X-             }
  1999. X-             break;
  2000. X          case S_STALKER:
  2001. X          case S_EEL:
  2002. X              mtmp->minvis = 1;
  2003. X--- 531,536 ----
  2004. X***************
  2005. X*** 536,542 ****
  2006. X                  mtmp->mpeaceful = 1;
  2007. X              break;
  2008. X      }
  2009. X!     if (ptr == &mons[PM_WIZARD_OF_YENDOR]) {
  2010. X          mtmp->iswiz = 1;
  2011. X          flags.no_of_wizards++;
  2012. X      }
  2013. X--- 552,568 ----
  2014. X                  mtmp->mpeaceful = 1;
  2015. X              break;
  2016. X      }
  2017. X!     if (ptr == &mons[PM_CHAMELEON]) {
  2018. X!         /* If you're protected with a ring, don't create
  2019. X!          * any shape-changing chameleons -dgk
  2020. X!          */
  2021. X!         if (Protection_from_shape_changers)
  2022. X!             mtmp->cham = 0;
  2023. X!         else {
  2024. X!             mtmp->cham = 1;
  2025. X!             (void) newcham(mtmp, rndmonst());
  2026. X!         }
  2027. X!     } else if (ptr == &mons[PM_WIZARD_OF_YENDOR]) {
  2028. X          mtmp->iswiz = 1;
  2029. X          flags.no_of_wizards++;
  2030. X      }
  2031. X***************
  2032. X*** 559,565 ****
  2033. X              }
  2034. X          }
  2035. X      }
  2036. X! #ifdef HARD
  2037. X      if(is_dprince(ptr)) {
  2038. X          mtmp->mpeaceful = mtmp->minvis = 1;
  2039. X  # ifdef NAMED_ITEMS
  2040. X--- 585,591 ----
  2041. X              }
  2042. X          }
  2043. X      }
  2044. X! #ifdef INFERNO
  2045. X      if(is_dprince(ptr)) {
  2046. X          mtmp->mpeaceful = mtmp->minvis = 1;
  2047. X  # ifdef NAMED_ITEMS
  2048. X***************
  2049. X*** 629,635 ****
  2050. X          range++;
  2051. X      } while(tfoo == foo);
  2052. X  foofull:
  2053. X!     i = rn2(tfoo - foo);
  2054. X      cc->x = foo[i].x;
  2055. X      cc->y = foo[i].y;
  2056. X      return;
  2057. X--- 655,661 ----
  2058. X          range++;
  2059. X      } while(tfoo == foo);
  2060. X  foofull:
  2061. X!     i = rn2((int)(tfoo - foo));
  2062. X      cc->x = foo[i].x;
  2063. X      cc->y = foo[i].y;
  2064. X      return;
  2065. X***************
  2066. X*** 779,785 ****
  2067. X                      || (tmp2 == AD_WERE)
  2068. X  #endif
  2069. X                                  ) n += 2;
  2070. X!         else n += (tmp2 != AD_PHYS);
  2071. X          n += ((ptr->mattk[i].damd * ptr->mattk[i].damn) > 23);
  2072. X      }
  2073. X  
  2074. X--- 805,811 ----
  2075. X                      || (tmp2 == AD_WERE)
  2076. X  #endif
  2077. X                                  ) n += 2;
  2078. X!         else if (ptr != &mons[PM_GRID_BUG]) n += (tmp2 != AD_PHYS);
  2079. X          n += ((ptr->mattk[i].damd * ptr->mattk[i].damn) > 23);
  2080. X      }
  2081. X  
  2082. X***************
  2083. X*** 935,944 ****
  2084. X      newtype = little_to_big(monsndx(ptr));
  2085. X      if (++mtmp->m_lev >= mons[newtype].mlevel) {
  2086. X          if (mons[newtype].geno & G_GENOD) {
  2087. X!             pline("As %s grows up into a%s %s, %s dies!",
  2088. X                  mon_nam(mtmp),
  2089. X!                 index(vowels,*mons[newtype].mname) ? "n" : "",
  2090. X!                 mons[newtype].mname,
  2091. X                  mon_nam(mtmp));
  2092. X              mondied(mtmp);
  2093. X              return (struct permonst *)0;
  2094. X--- 961,969 ----
  2095. X      newtype = little_to_big(monsndx(ptr));
  2096. X      if (++mtmp->m_lev >= mons[newtype].mlevel) {
  2097. X          if (mons[newtype].geno & G_GENOD) {
  2098. X!             pline("As %s grows up into %s, %s dies!",
  2099. X                  mon_nam(mtmp),
  2100. X!                 an(mons[newtype].mname),
  2101. X                  mon_nam(mtmp));
  2102. X              mondied(mtmp);
  2103. X              return (struct permonst *)0;
  2104. X***************
  2105. X*** 1111,1118 ****
  2106. X      else if (OBJ_AT(mtmp->mx, mtmp->my))
  2107. X          sym = level.objects[mtmp->mx][mtmp->my]->olet;
  2108. X      else if (IS_DOOR(levl[mtmp->mx][mtmp->my].typ) ||
  2109. X!          IS_WALL(levl[mtmp->mx][mtmp->my].typ))
  2110. X!         sym = DOOR_SYM;
  2111. X      else if (is_maze_lev)
  2112. X          sym = rn2(2) ? ROCK_SYM : syms[rn2(sizeof syms)];
  2113. X      else if (roomno < 0)
  2114. X--- 1136,1145 ----
  2115. X      else if (OBJ_AT(mtmp->mx, mtmp->my))
  2116. X          sym = level.objects[mtmp->mx][mtmp->my]->olet;
  2117. X      else if (IS_DOOR(levl[mtmp->mx][mtmp->my].typ) ||
  2118. X!          IS_WALL(levl[mtmp->mx][mtmp->my].typ) ||
  2119. X!          levl[mtmp->mx][mtmp->my].typ == SDOOR ||
  2120. X!          levl[mtmp->mx][mtmp->my].typ == SCORR)
  2121. X!         sym = CLOSED_DOOR_SYM;
  2122. X      else if (is_maze_lev)
  2123. X          sym = rn2(2) ? ROCK_SYM : syms[rn2(sizeof syms)];
  2124. X      else if (roomno < 0)
  2125. END_OF_FILE
  2126. if test 54581 -ne `wc -c <'patches06g'`; then
  2127.     echo shar: \"'patches06g'\" unpacked with wrong size!
  2128. fi
  2129. # end of 'patches06g'
  2130. fi
  2131. echo shar: End of archive 6 \(of 15\).
  2132. cp /dev/null ark6isdone
  2133. MISSING=""
  2134. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
  2135.     if test ! -f ark${I}isdone ; then
  2136.     MISSING="${MISSING} ${I}"
  2137.     fi
  2138. done
  2139. if test "${MISSING}" = "" ; then
  2140.     echo You have unpacked all 15 archives.
  2141.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2142. else
  2143.     echo You still need to unpack the following archives:
  2144.     echo "        " ${MISSING}
  2145. fi
  2146. ##  End of shell archive.
  2147. exit 0
  2148.